﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using TDT_Project.classes;
namespace TDT_Project.Controller
{
    public partial class uc_Nhan_Xet_Chi_Tiet : System.Web.UI.UserControl
    {
       
        cls_user_dang_nhap cls = new cls_user_dang_nhap();
        private DataSet ds = new DataSet();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                try
                {
                    if (Session["gv"] != null)
                    {
                        DataSet ds = cls.Get_NhanXet_PH_For_GV(Session["lop"].ToString(), Session["nk"].ToString(), "HK1", 0);
                        gvResult_NHAN_XET_CT.DataSource = ds.Tables[0].DefaultView;
                        gvResult_NHAN_XET_CT.DataBind();
                    }
                    else
                        Response.Redirect("Default.aspx");
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
        }

        protected void RadioButtonList1_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (Session["gv"] != null)
            {
                DataSet ds = cls.Get_NhanXet_PH_For_GV(Session["lop"].ToString(), Session["nk"].ToString(), RadioButtonList1.SelectedValue.ToString()=="HK1"?"HK1":"HK2", 0);
                gvResult_NHAN_XET_CT.DataSource = ds.Tables[0].DefaultView;
                gvResult_NHAN_XET_CT.DataBind();
            }
            else
                Response.Redirect("Default.aspx");
        }
    }
}